// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  compatibilityDate: '2024-11-01',
  devtools: { enabled: true, timeline: { enabled: true } },
  modules: ['@nuxtjs/tailwindcss', '@vite-pwa/nuxt'],
  pwa: {
    registerType: 'autoUpdate',
    manifest: {
      name: 'Nuxt 3 PWA',
      short_name: 'NuxtPWA',
      description: 'Nuxt 3 Progressive Web App',
      theme_color: '#ffff',
      icons: [
        {
          src: 'pwa-192x192.png',
          sizes: '192x192',
        },
        {
          src:"pwa-512x512.png",
          sizes: "512x512",
        }
      ],
    },
    workbox: {
      globPatterns: ['**/*.{js,css,html,png,svg,ico}'],
    },
    injectManifest: {
      globPatterns: ['**/*.{js,css,html,png,svg,ico}'],
    },
    client: {
      installPrompt: true,
      periodicSyncForUpdates: 20,
    },
    devOptions: {
      enabled: true,
      suppressWarnings: true,
      navigateFallback: '/',
      navigateFallbackAllowlist: [/^\/$/],
      type: 'module',
    },
  },
  vite:{
    logLevel: "info",
  },
  appConfig: {
    buildDate: new Date().toISOString(),
  },
  imports: {
    autoImport: true,
  },
})
